import axios from '../../axios';

const homePageApi = {
    getProducts: function (params) {
        //发请求
        return axios({
            url: "/products/getProducts",
            method: "get",
            params
        })
    },
    //获取商品详情
    getProductsInfo: function (params) {
        return axios({
            url: "/products/getProductsInfo",
            method: 'get',
            params
        })
    },
    //生成订单
    createOrder: function (params) {
        return axios({
            url: '/order/createOrder',
            method: "post",
            data: params
        })
    },
    //获取当前用户个人信息
    getMessage: function (params) {
        return axios({
            url: "/order/getMessage",
            method: 'get',
            params
        })
    },
    //修改个人信息
    updateMsg: function (params) {
        return axios({
            url: '/customer/updateAll',
            method: "post",
            data: params
        })
    },
    //获取我的订单
    getMyOrder: function (params) {
        return axios({
            url: "/order/getMyOrder",
            method: "get",
            params
        })
    },
    //充值
    updateWallet: function (params) {
        return axios({
            url: "/customer/updateWallet",
            method: "post",
            data: params
        })
    },
    //理赔申请
    createCompensation: function (params) {
        return axios({
            url: "/compensation/createCompensation",
            method: "post",
            data: params
        })
    }
}
export default homePageApi;